
#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Measure.h>
#include <VolumeUnit.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Measure)
{
    TEST(should be able to display 41 TSP as 6 OZ 1 TBSP 2 TSP)
    {
        Measure<VolumeUnit> volume (41, TSP);
        ASSERT_EQ(string(" 6 OZ 1 TBSP 2 TSP"), volume.print(OZ));
    }

    TEST(should be able to display 2 OZ as 12TSP)
    {
        Measure<VolumeUnit> volume (2,OZ);
        ASSERT_EQ(string(" 12 TSP"), volume.print(TSP));
    }

    TEST(should be able to compare 3 OZ + 4 TBSP = 30 TSP)
    {
        Measure<VolumeUnit> volume1(3, OZ);
        Measure<VolumeUnit> volume2(4, TBSP);
        Measure<VolumeUnit> volume3(30,TSP);
        ASSERT_TRUE(volume3 == (volume1 + volume2));
    }
        
    TEST(should be able to compare 2 OZ = 12 TSP)
    {
        Measure<VolumeUnit> volume1(2, OZ);
        Measure<VolumeUnit> volume2(12,TSP);
        ASSERT_TRUE(volume2  == volume1);
    }


    TEST(should be able to compare 4 OZ = 8 TBSP)
    {
        Measure<VolumeUnit> volume1(4, OZ);
        Measure<VolumeUnit> volume2(8,TBSP);
        ASSERT_TRUE(volume2  == volume1);
    }

    TEST(should be able to compare 4 TBSP = 12 TSP)
    {
        Measure<VolumeUnit> volume1(4, TBSP);
        Measure<VolumeUnit> volume2(12,TSP);
        ASSERT_TRUE(volume1  == volume2); 
    }

    TEST(should be able to compare 5 OZ + 4 TBSP != 30 TSP)
    {
        Measure<VolumeUnit> volume1(5, OZ);
        Measure<VolumeUnit> volume2(4, TBSP);
        Measure<VolumeUnit> volume3(30,TSP);
        ASSERT_FALSE(volume3  == (volume2 + volume1));
    }
};

